<!DOCTYPE html>
<html>

<head>

    <meta charset="UTF-8">

    <title><?php echo \Illuminate\Support\Facades\Config::get("app.name")?></title>

    <link rel="stylesheet" href="/font-awesome/css/font-awesome.min.css">

    <link rel='stylesheet' href='/logincss/css/jquery-ui.css'>
    <link rel='stylesheet prefetch' href='/logincss/css/bootstrap.min.css'>

    <link rel="stylesheet" href="/logincss/css/style.css" media="screen" type="text/css" />

    <script src="/logincss/js/modernizr.js"></script>

</head>

<body class="login-page">
<div class="login-form">

    <div class="login-content">

        <div class="form-login-error">
            <h3>Invalid login</h3>
            <p>Enter <strong>demo</strong>/<strong>demo</strong> as login and password.</p>
        </div>
        <img src="/img/logo/logo-alt.png" height="40" alt="logo name"><br/><br/>
        <form method="post" role="form" id="form_login">
            {!! csrf_field() !!}
            <input type="hidden" class="uniform" name="remember"/>
            <div class="form-group">

                <div class="input-group">
                    <div class="input-group-addon">
                        <i class="fa fa-user"></i>
                    </div>

                    <input type="text" class="form-control" name="email" id="username" placeholder="账号" value="{{ old('email') }}" autocomplete="off" />
                </div>

            </div>

            <div class="form-group" id="div-password">

                <div class="input-group">
                    <div class="input-group-addon">
                        <i class="fa fa-key"></i>
                    </div>

                    <input type="password" class="form-control" name="password" id="password" placeholder="密码" autocomplete="off"/>
                </div>

            </div>

            <div class="form-group" style="width:190px;" id="div-captcha">

                <div class="input-group">
                    <div class="input-group-addon">
                        <i class="fa fa-font"></i>
                    </div>

                    <input type="text" class="form-control" name="captcha" id="captcha" placeholder="验证码" autocomplete="off" />

                </div>
                <div style="position:absolute; top:218px; left:200px;"><a href="javascript:;"><img src="/captcha" id="captcha" onclick="captcha2(this)"/></a></div>
            </div>

            <div class="form-group">
                <button type="submit" class="btn btn-primary btn-block btn-login">
                    <i class="fa fa-sign-in"></i>
                    登录
                </button>
            </div>

        </form>

        <div style="text-align:center;clear:both;">

        </div>

    </div>

</div>
</div>
<script src="/js/jquery/jquery-2.0.3.min.js"></script>
<script src="/bootstrap-dist/js/bootstrap.min.js"></script>
<script>

    function captcha2(dom) {
        var timestamp = Date.parse(new Date());
        timestamp = timestamp / 1000;
        $(dom).attr("src", "/captcha?time=" + timestamp);
    }

    <?php if (count($errors) > 0):?>
    $("#div-password").popover({"placement":"left","content":"密码错误","trigger":"manual"});
    $("#div-password").popover("show");
    <?php endif?>

    <?php if ($request->session()->get("captchaError")):?>
    <?php $request->session()->remove("captchaError");?>
    $("#div-captcha").popover({"placement":"left","content":"验证码错误","trigger":"manual"});
    $("#div-captcha").popover("show");
    <?php endif?>
</script>
</body>

</html>

